//===================================
//File: Collect.cpp
//Сollection functions
//Name: Smirnova O.P.
//Date: 02.04.12, v.1.0
//===================================
#include "Collect.h"
//---------------------------------------------------------------------------


Collection::Collection()
{
	this->images = new MultiList<Image>();
};

Collection::Collection(MultiList<Image> *images)
{
 //cout << "\nCollection():\n";
 this->images = images;
 //cout << "Collection()\n";
};

Collection::~Collection()
{
	//cout << "\n~Collection:\n";
	//cout << "~Collection\n";
};
void Collection::writeList()
{
	images->writeList();
}
MultiList<Image> * Collection::getCollection()
{
	return images;
};
void Collection::addToList(Image* img) {
	images->addElem(*img);
};
void Collection::moveTo (Point p)
{
	MultiListElem<Image>* temp = images->getRootListA();
	while (temp != 0)
	{
		Image el = temp->getValue();
		el.moveTo(p);
		temp->setValue(el);
		temp = temp->getElema();
	};
};

void Collection::moveTodXdY (double x, double y)
	{

	MultiListElem<Image>* temp = images->getRootListA();
	while (temp != 0)
	{
		Image el = temp->getValue();
		el.moveTodXdY(x,y);
		temp->setValue(el);
		temp = temp->getElema();
	};
};

void Collection::consS (Point p)
	{

	MultiListElem<Image>* temp = images->getRootListA();
	while (temp != 0)
	{
		Image el = temp->getValue();
		el.consSF(p);
		temp->setValue(el);
		temp = temp->getElema();
	};
};
